package net.zhengxinyun.performance.mapper.Indicators;

import net.zhengxinyun.performance.entity.CountryIndicatorsEntity;
import net.zhengxinyun.performance.filter.CountryIndicatorsFilter;
import net.zhengxinyun.performance.filter.IndexFilter;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface CountryIndicatorsEntityMapper {

    int deleteByPrimaryKey(Long id);


    int insert(CountryIndicatorsEntity record);


    int insertSelective(CountryIndicatorsEntity record);


    CountryIndicatorsEntity selectByPrimaryKey(Long id);


    int updateByPrimaryKeySelective(CountryIndicatorsEntity record);

    int updateByPrimaryKey(CountryIndicatorsEntity record);

    List<CountryIndicatorsFilter> query(CountryIndicatorsFilter countryIndicatorsFilter);

    Integer queryForCount(CountryIndicatorsFilter countryIndicatorsFilter);

    String getIdByIndexName(Map<String,Object> map);

    List<CountryIndicatorsFilter> queryByTwoTable(CountryIndicatorsFilter filter);

    Integer queryByTwoTableCount(CountryIndicatorsFilter countryIndicatorsFilter);

    List<CountryIndicatorsFilter> queryForAudit(CountryIndicatorsFilter filter);

    Integer queryForAuditCount(CountryIndicatorsFilter countryIndicatorsFilter);

    /**
     * 查询是否同样的上级指标是否有还没有设置最终得分的数量
     * @param countryIndicatorsEntity
     * @return
     */
    int queryNullFinal (CountryIndicatorsEntity countryIndicatorsEntity);

    /**
     * 查询相同上级id的最终得分的和
     * @param countryIndicatorsEntity
     * @return
     */
    double queryFirstFinalScore(CountryIndicatorsEntity countryIndicatorsEntity);

    /**
     * 根据上级指标id删除
     * @param superId
     * @return
     */
    int deleteBySuperId(String superId);

    /**
     * 首页图表
     * @param indexFilter
     * @return
     */
    List<CountryIndicatorsFilter> indexCountry(IndexFilter indexFilter);

    /**
     * 首页图表反向
     * @param indexFilter
     * @return
     */
    List<CountryIndicatorsFilter> indexCountryReverse(IndexFilter indexFilter);

    /**
     * 设置指标预警时间
     * @param countryIndicatorsEntity
     * @return
     */
    int setEndTime(CountryIndicatorsEntity countryIndicatorsEntity);

    /**
     * 查询需要预警的信息
     * @param countryIndicatorsFilter
     * @return
     */
    List<CountryIndicatorsFilter> queryWarn(CountryIndicatorsFilter countryIndicatorsFilter);

}